//
//  LPTMediModel.m
//  LPTClient
//
//  Created by mac on 2018/12/16.
//  Copyright © 2018年 zhaodd. All rights reserved.
//

#import "LPTMediModel.h"
#import "LPTCategoryModel.h"

@implementation LPTMediModel

+ (nullable NSDictionary<NSString *, id> *)modelContainerPropertyGenericClass
{
    return @{
             @"chinese_medicine" : LPTMediDetailModel.class,
             };
}

+(LPTMediModel *)modelWithMedicineModel:(LPTMedicineModel *)model
{
    LPTMediModel *mediModel = [[LPTMediModel alloc] init];
    mediModel.weight = 1;
    
    LPTMediDetailModel *detailModel = [[LPTMediDetailModel alloc] init];
    detailModel.mediId = model.medicineId;
    detailModel.name = model.name;
    detailModel.price = model.price;
    mediModel.chinese_medicine = detailModel;
    return mediModel;
}

@end

@implementation LPTMediDetailModel

+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper
{
    return @{
             @"mediId" : @"id",
             };
}

@end
